#include <iostream>
#include <vector>
#include <string>
#include   <cstring>
#include "util.h"
#include "db.h"

bool is_not_endl(char m)
{
    if (((m >= 'a') && (m <= 'z')) || ((m >= 'A') && (m <= 'Z')))
        return true;
    return false;
}
std::vector<std::string> where_parse(char ins[], int i){
    std::vector<std::string> strs;
    //移动到where后的属性
    std::string col_name;
    i++;
    while(i < 100 && ins[i] != '>' && ins[i] != '='&& ins[i] != '<'){        
        col_name += ins[i];
        i++;
    }
    //获取运算符
    std::string op;
    op += ins[i]; 
    std::string compare;
    i++;
    while(i < (int)strlen(ins) && ins[i] != ' ' && ins[i] != '\0'){
        compare += ins[i];
        i++;
    }
    strs.push_back(col_name);
    strs.push_back(op);
    strs.push_back(compare);

    return strs;
}

void check_dbPath(){
    if(dbPath.empty()){
        std::cout << "请先打开一个数据库 "<< std::endl;
    }
}